package com.domain;

import java.io.Serializable;
import java.util.StringJoiner;

/**
 *
 */
public class User implements Serializable  {

    private static final long serialVersionUID = 1L;

    /**
     * 用户ID
     */
    private int id;
    /**
     * 用户昵称
     */
    private String name;

    private  int  age;


    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }



    //最后发现是我在代码最后写了个有参构造，重载了构造函数，而Mybatis在load进一个bean类时，需要无参构造从而导致了该错误，
    //解决方法，给代码加上午参构造即可！  https://blog.csdn.net/sunrise_zhu/article/details/53309767
    public  User() {
       super();
    }

    public User(int id, String name, int age) {
        this.id = id;
        this.name = name;
        this.age = age;
    }

    @Override
    public String toString() {
        return "User{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", age=" + age +
                '}';
    }
}
